pub mod export;

pub use export::*;

#[macro_export]
/// 创建基本模式
macro_rules! create_std_mode {
    ($N:ident) => {
        pub struct $N {
            offset_x: f32,
            offset_y: f32,
            iter_times: usize,
            conver_val: f32,
            pow: usize,
        }

        impl $N {
            pub fn new() -> Self {
                Self::default()
            }
            pub fn set_offset(mut self, x: f32, y: f32) -> Self {
                self.offset_x = x;
                self.offset_y = y;
                self
            }

            pub fn set_pow(mut self, pow: usize) -> Self {
                self.pow = pow;
                self
            }

            pub fn set_times(mut self, times: usize) -> Self {
                self.iter_times = times;
                self
            }
        }

        impl Default for $N {
            fn default() -> Self {
                Self {
                    offset_x: 0.0,
                    offset_y: 0.0,
                    iter_times: 30,
                    pow: 1,
                    conver_val: 4.0,
                }
            }
        }
    };

    ($($N:ident), *) => {
        $(
            create_std_mode!($N);
        )*
    };
}
